#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int bin_search(int arr[], int left, int right, int key)
{

	while (left <= right)
	{
		int mid =  (left + right) / 2;
		if (arr[mid] < key)
		{
			left = mid + 1;
		}
		else if (arr[mid] > key)
		{
			right = mid - 1;
		}
		else
			return mid;
	}
	return -1;
}
int main()
{
	int arr[10] = { 0,1,2,3,4,5,6,7,8,9 };
	int right = sizeof(arr) / sizeof(arr[0])-1;
	int left = 0;
	int key=0;
	scanf("%d", &key);
	printf("%d", bin_search(arr, left, right, key));
	return 0;
}